<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   
<script type="text/javascript">
function mg_savecodebantime(type)
{

    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "mg/bantime/save.do?type=" + type;
    var objectid = "mg_codebantime";
    postXMLHttpRequest(url, "myform", objectid); 
}
function manage_spbantime_checkallprovince(obj)
{
	var ckbs = document.getElementsByName("model.filterProvince");
	if (obj.checked == true)
	{
		for (var n = 0; n < ckbs.length; n++)
		{
			ckbs[n].checked = true;
		}
	}
	else
	{
		for (var n = 0; n < ckbs.length; n++)
		{
			ckbs[n].checked = false;
		}
	}
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform" name="myform" id="myform"
        method="post" action="">
        <input type="hidden" id="model.id" name="model.id"  value="<s:property value="model.id" />" />
        <input type="hidden" id="model.createUser" name="model.createUser"  value="<s:property value="model.createUser" />" />
        <input type="hidden" id="model.createDate" name="model.createDate"  value="<s:property value="model.createDate" />" />
        
        <input type="hidden" id="spId" name="spId"  value="<s:property value="spId" />" />
        <input type="hidden" id="codeType" name="codeType"  value="<s:property value="codeType" />" />
        <input type="hidden" id="model.spCodeId" name="model.spCodeId"  value="<s:property value="model.spCodeId" />" />
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">过滤信息</strong></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>省份：
      <input type="checkbox" onclick="manage_spbantime_checkallprovince(this);" /></td>
      <td class="table_w2" colspan="2">&nbsp;
          <div >
        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
        <tr style="visibility: true">
        <s:iterator value="%{getProvinces()}" status="stat">
        <s:if test="#stat.index>0&&#stat.index%8==0"></tr><tr></s:if>
        <td width="10%" class="table_w2" align="left">&nbsp;&nbsp;<input type="checkbox"  
        <s:if test="(','+model.banTimeProvince+',').indexOf(','+code+',')!=-1">checked</s:if> 
        name="model.banTimeProvince" id="model.banTimeProvince" value="<s:property value="code" />">&nbsp;<s:property value="name" /></td>
        </s:iterator>
        </tr>
        </table></div>
          </td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>开始时间：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="model.banTimeStart" name="model.banTimeStart" type="text" size="60" 
          value="<s:property value="model.banTimeStart" />" /></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>结束时间：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="model.banTimeEnd" name="model.banTimeEnd" type="text" size="60" 
          value="<s:property value="model.banTimeEnd" />" /></td>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')" >
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="mg_savecodebantime('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="mg_savecodebantime('update');">修改</button>
        &nbsp;&nbsp;        
        <button id="btn4" dojoType="dijit.form.Button"
            onclick="mg_savecodebantime('delete');">删除</button>
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>